<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Class: ActiveSupport::Cache::SynchronizedMemoryStore</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Class</strong></td>
          <td class="class-name-in-header">ActiveSupport::Cache::SynchronizedMemoryStore</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../../../files/vendor/rails/activesupport/lib/active_support/cache/synchronized_memory_store_rb.html">
                vendor/rails/activesupport/lib/active_support/cache/synchronized_memory_store.rb
                </a>
        <br />
            </td>
        </tr>

        <tr class="top-aligned-row">
            <td><strong>Parent:</strong></td>
            <td>
                <a href="MemoryStore.html">
                MemoryStore
               </a>
            </td>
        </tr>
        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">

    <div id="description">
      <p>
Like <a href="MemoryStore.html">MemoryStore</a>, but thread-safe.
</p>

    </div>


   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000351">clear</a>&nbsp;&nbsp;
      <a href="#M000350">decrement</a>&nbsp;&nbsp;
      <a href="#M000346">delete</a>&nbsp;&nbsp;
      <a href="#M000347">delete_matched</a>&nbsp;&nbsp;
      <a href="#M000348">exist?</a>&nbsp;&nbsp;
      <a href="#M000343">fetch</a>&nbsp;&nbsp;
      <a href="#M000349">increment</a>&nbsp;&nbsp;
      <a href="#M000342">new</a>&nbsp;&nbsp;
      <a href="#M000344">read</a>&nbsp;&nbsp;
      <a href="#M000345">write</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">





      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Class methods</h3>

      <div id="method-M000342" class="method-detail">
        <a name="M000342"></a>

        <div class="method-heading">
          <a href="#M000342" class="method-signature">
          <span class="method-name">new</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000342-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000342-source">
<pre>
   <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/cache/synchronized_memory_store.rb, line 5</span>
5:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
6:         <span class="ruby-keyword kw">super</span>
7:         <span class="ruby-ivar">@guard</span> = <span class="ruby-constant">Monitor</span>.<span class="ruby-identifier">new</span>
8:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000351" class="method-detail">
        <a name="M000351"></a>

        <div class="method-heading">
          <a href="#M000351" class="method-signature">
          <span class="method-name">clear</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000351-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000351-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/cache/synchronized_memory_store.rb, line 42</span>
42:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">clear</span>
43:         <span class="ruby-ivar">@guard</span>.<span class="ruby-identifier">synchronize</span> { <span class="ruby-keyword kw">super</span> }
44:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000350" class="method-detail">
        <a name="M000350"></a>

        <div class="method-heading">
          <a href="#M000350" class="method-signature">
          <span class="method-name">decrement</span><span class="method-args">(key, amount = 1)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000350-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000350-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/cache/synchronized_memory_store.rb, line 38</span>
38:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">decrement</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">amount</span> = <span class="ruby-value">1</span>)
39:         <span class="ruby-ivar">@guard</span>.<span class="ruby-identifier">synchronize</span> { <span class="ruby-keyword kw">super</span> }
40:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000346" class="method-detail">
        <a name="M000346"></a>

        <div class="method-heading">
          <a href="#M000346" class="method-signature">
          <span class="method-name">delete</span><span class="method-args">(name, options = nil)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000346-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000346-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/cache/synchronized_memory_store.rb, line 22</span>
22:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">delete</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">options</span> = <span class="ruby-keyword kw">nil</span>)
23:         <span class="ruby-ivar">@guard</span>.<span class="ruby-identifier">synchronize</span> { <span class="ruby-keyword kw">super</span> }
24:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000347" class="method-detail">
        <a name="M000347"></a>

        <div class="method-heading">
          <a href="#M000347" class="method-signature">
          <span class="method-name">delete_matched</span><span class="method-args">(matcher, options = nil)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000347-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000347-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/cache/synchronized_memory_store.rb, line 26</span>
26:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">delete_matched</span>(<span class="ruby-identifier">matcher</span>, <span class="ruby-identifier">options</span> = <span class="ruby-keyword kw">nil</span>)
27:         <span class="ruby-ivar">@guard</span>.<span class="ruby-identifier">synchronize</span> { <span class="ruby-keyword kw">super</span> }
28:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000348" class="method-detail">
        <a name="M000348"></a>

        <div class="method-heading">
          <a href="#M000348" class="method-signature">
          <span class="method-name">exist?</span><span class="method-args">(name,options = nil)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000348-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000348-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/cache/synchronized_memory_store.rb, line 30</span>
30:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">name</span>,<span class="ruby-identifier">options</span> = <span class="ruby-keyword kw">nil</span>)
31:         <span class="ruby-ivar">@guard</span>.<span class="ruby-identifier">synchronize</span> { <span class="ruby-keyword kw">super</span> }
32:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000343" class="method-detail">
        <a name="M000343"></a>

        <div class="method-heading">
          <a href="#M000343" class="method-signature">
          <span class="method-name">fetch</span><span class="method-args">(key, options = {})</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000343-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000343-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/cache/synchronized_memory_store.rb, line 10</span>
10:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">options</span> = {})
11:         <span class="ruby-ivar">@guard</span>.<span class="ruby-identifier">synchronize</span> { <span class="ruby-keyword kw">super</span> }
12:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000349" class="method-detail">
        <a name="M000349"></a>

        <div class="method-heading">
          <a href="#M000349" class="method-signature">
          <span class="method-name">increment</span><span class="method-args">(key, amount = 1)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000349-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000349-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/cache/synchronized_memory_store.rb, line 34</span>
34:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">increment</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">amount</span> = <span class="ruby-value">1</span>)
35:         <span class="ruby-ivar">@guard</span>.<span class="ruby-identifier">synchronize</span> { <span class="ruby-keyword kw">super</span> }
36:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000344" class="method-detail">
        <a name="M000344"></a>

        <div class="method-heading">
          <a href="#M000344" class="method-signature">
          <span class="method-name">read</span><span class="method-args">(name, options = nil)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000344-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000344-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/cache/synchronized_memory_store.rb, line 14</span>
14:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">read</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">options</span> = <span class="ruby-keyword kw">nil</span>)
15:         <span class="ruby-ivar">@guard</span>.<span class="ruby-identifier">synchronize</span> { <span class="ruby-keyword kw">super</span> }
16:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000345" class="method-detail">
        <a name="M000345"></a>

        <div class="method-heading">
          <a href="#M000345" class="method-signature">
          <span class="method-name">write</span><span class="method-args">(name, value, options = nil)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000345-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000345-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/cache/synchronized_memory_store.rb, line 18</span>
18:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">write</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">value</span>, <span class="ruby-identifier">options</span> = <span class="ruby-keyword kw">nil</span>)
19:         <span class="ruby-ivar">@guard</span>.<span class="ruby-identifier">synchronize</span> { <span class="ruby-keyword kw">super</span> }
20:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>